﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PServiceBus.Services.Gateway.Runtime;
using System.Threading;

namespace Invoicing.Client {
    class Program {
        static void Main(string[] args) {
            var rand = new Random();
            Console.WriteLine("Press enter to send invoice request. Type exit to exit");
            while (true) {
                var text = Console.ReadLine();
                if (text.ToLower() == "exit") {
                    break;
                } else {
                    Topic.PublishMessage(new Messages.InvoiceRequest()
                    {
                        Amount = rand.NextDouble() * 1000,
                        ID = rand.Next(1000),
                        Customer = new Messages.Customer() { Address = "This is an address field", Name = "FileName" + rand.Next() }
                    });
                }
            }

        }
    }
}
